<?php /* Smarty version 2.6.20, created on 2016-06-29 11:09:56
         compiled from order.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'order.htm', 195, false),array('modifier', 'date_format', 'order.htm', 195, false),array('modifier', 'number_format', 'order.htm', 324, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>订单管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script language="javascript" src="../script/Calendar.js"></script>
<script type="text/javascript">
//展开订单商品列表
window.flag = false;
function showOrderProductsList(orderId){
	var _this = $('#order_pro_'+orderId);
    if(flag){
        return;
    }
    var tclass = _this.attr('act');
    flag = true;
    if(tclass=='show'){
        $.get('?m=product&s=order.php',{'order_id':orderId,'act':'getOrderProductList'},function(data){
            _this.parent().parent().after(data);
            _this.attr('act','hide');
            _this.attr('src','../image/admin/hidechild.png');
            flag = false;
        });
    }else if(tclass=='hide'){
        _this.parent().parent().next().remove();
        _this.attr('act','show');
        _this.attr('src','../image/admin/addchildboard.png');
        flag = false;
    }
}
</script>
</head>
<body>
<div class="container">
    <div class="flow">
        <div class="itemtitle">
            <h3>订单管理</h3>
            <ul>
                <li <?php if ($_GET['status'] == ''): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
<?php if ($_GET['userid'] > 0): ?>&userid=<?php echo $_GET['userid']; ?>
<?php endif; ?>"><span>管理</span></a></li>
                <?php $_from = $this->_tpl_vars['order_shop_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['list']):
?>
                <li <?php if ($_GET['status'] == $this->_tpl_vars['num']+1): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&status=<?php echo $this->_tpl_vars['num']+1; ?>
<?php if ($_GET['userid'] > 0): ?>&userid=<?php echo $_GET['userid']; ?>
<?php endif; ?>"><span><?php echo $this->_tpl_vars['list']; ?>
</span></a></li>
              	<?php endforeach; endif; unset($_from); ?>
            </ul>
        </div>
    </div>
    <div class="h35"></div>
    <table class="select_table">
        <tr>    
            <td>
            	<div class="select_box">
                <form action="" method="get">
                    <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                    <input type="hidden" name="s" value="order.php">
                    <input type="hidden" name="onlytoday" value="<?php echo $_GET['onlytoday']; ?>
">
                    <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>
">
										<select name="stock_shop" id="stock_shop" style="float:left;">
                <option value="" <?php if ($this->_tpl_vars['general_shop'] != 0): ?>disabled<?php endif; ?>>全部</option>
                <?php $_from = $this->_tpl_vars['stock_shops']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <option value="<?php echo $this->_tpl_vars['list']['id']; ?>
" <?php if ($_GET['stock_shop'] == $this->_tpl_vars['list']['id']): ?>selected<?php endif; ?> <?php if ($this->_tpl_vars['general_shop'] != 0 && $this->_tpl_vars['general_shop'] != $this->_tpl_vars['list']['id']): ?>disabled<?php endif; ?>><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
                
                <?php endforeach; endif; unset($_from); ?>
                </select>
                    <input placeholder="请输入订单编号..." type="text" name="code" class="txt w250" value="<?php echo $_GET['code']; ?>
" />
                    <input type="submit" value="搜索" />
                </form>
                </div>
                <div class="search">
                	<a class="a-search" href="#">高级搜索</a>
                	<div class="div-search">
                        <div class="close"></div>
                        <div class="line"></div>
                        <div class="search-con clearfix">
                        <form action="" method="get">
                        <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                        <input type="hidden" name="s" value="order.php">
                        <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>
">
                        <input type="hidden" name="stock_shop" id="stock_shop_t" value="<?php echo $_GET['stock_shop']; ?>
">
                        <dl>
                            <dt>订单编号</dt>
                            <dd><input type="text" class="w250" name="code" value="<?php echo $_GET['code']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>订单类型</dt>
                            <dd>
                            <select name="order_type" class="w250">
                            <option value="">--全部--</option>
                            <option <?php if ($_GET['order_type'] == 1): ?>selected="selected"<?php endif; ?> value="1">普通订单</option>
                            <option <?php if ($_GET['order_type'] == 2): ?>selected="selected"<?php endif; ?> value="2">分销订单</option>
                            <option <?php if ($_GET['order_type'] == 3): ?>selected="selected"<?php endif; ?> value="3">微店订单</option>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>支付状态</dt>
                            <dd>
                            <select name="order_pay_status" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['order_pay_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['order_pay_status'] == $this->_tpl_vars['key']+1): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['key']+1; ?>
"><?php echo $this->_tpl_vars['list']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>支付方式</dt>
                            <dd>
                            <select name="pay" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['pay']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['pay'] == $this->_tpl_vars['list']['payment_id']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['payment_id']; ?>
"><?php echo $this->_tpl_vars['list']['payment_name']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>  
                        <dl>
                            <dt>支付平台</dt>
                            <dd>
                            <select name="client_platform" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['client_platform']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['client_platform'] != ''): ?><?php if ($this->_tpl_vars['key'] == $_GET['client_platform']): ?>selected="selected"<?php endif; ?><?php endif; ?> value="<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['list']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>操作系统</dt>
                            <dd>
                            <select name="client_system" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['client_system']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['client_system'] != ''): ?><?php if ($this->_tpl_vars['key'] == $_GET['client_system']): ?>selected="selected"<?php endif; ?><?php endif; ?> value="<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['list']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>配送状态</dt>
                            <dd>
                            <select name="order_ship_status" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['order_ship_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['order_ship_status'] == $this->_tpl_vars['key']+1): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['key']+1; ?>
"><?php echo $this->_tpl_vars['list']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>配送方式</dt>
                            <dd>
                            <select name="ship" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['ship']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['ship'] == $this->_tpl_vars['list']['id']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>供应类型</dt>
                            <dd>
                            <select name="separate_status" class="w250">
                            <option value="">请选择</option>
                            <option value="0" <?php if ($_GET['separate_status'] == '0'): ?>selected<?php endif; ?>>自营</option>
                            <option value="-1" <?php if ($_GET['separate_status'] == -1): ?>selected<?php endif; ?>>供应商</option>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>物流单号</dt>
                            <dd>
                            <input type="text" class="w250" name="shipping_no" value="<?php echo $_GET['shipping_no']; ?>
" />
                            </dd>
                        </dl>                        
                        <dl>
                            <dt>订单总额</dt>
                            <dd>
                            <input type="text" class="w118" name="minp" value="<?php echo $_GET['minp']; ?>
" />
                            -
							<input type="text" class="w118" name="maxp" value="<?php echo $_GET['maxp']; ?>
" />
                            </dd>
                        </dl>
                        <dl>
                            <dt>下单时间</dt>
                            <dd>
                            <script language="javascript">
            var cdr = new Calendar("cdr");
            document.write(cdr);
            cdr.showMoreDay = true;
        </script>
                            <input onFocus="cdr.show(this);" class="w118" type="text" name="stime" id="stime" value="<?php echo $_GET['stime']; ?>
"">
                            -
							<input onFocus="cdr.show(this);" class="w118" type="text" name="etime" id="etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>                        
                        <dl>
                            <dt>支付时间</dt>
                            <dd>
                            <script language="javascript">
            var pcdr = new Calendar("pcdr");
            document.write(pcdr);
            pcdr.showMoreDay = true;
        </script>
                            <input onFocus="pcdr.show(this);" class="w118" type="text" name="p_stime" id="p_stime" value="<?php echo $_GET['p_stime']; ?>
"">
                            -
                            <input onFocus="pcdr.show(this);" class="w118" type="text" name="p_etime" id="p_etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['p_etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>                        
                        <dl>
                            <dt>发货时间</dt>
                            <dd>
                            <script language="javascript">
            var scdr = new Calendar("scdr");
            document.write(scdr);
            scdr.showMoreDay = true;
        </script>
                            <input onFocus="scdr.show(this);" class="w118" type="text" name="s_stime" id="s_stime" value="<?php echo $_GET['s_stime']; ?>
"">
                            -
                            <input onFocus="scdr.show(this);" class="w118" type="text" name="s_etime" id="s_etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['s_etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>
                        <dl>
                            <dt>买家名称</dt>
                            <dd><input type="text" class="w250" name="user" value="<?php echo $_GET['user']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>收货人</dt>
                            <dd><input type="text" class="w250" name="ship_name" value="<?php echo $_GET['ship_name']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>收货地址</dt>
                            <dd><input type="text" class="w250" name="ship_addr" value="<?php echo $_GET['ship_addr']; ?>
" /></dd>
                        </dl>
                    	<input type="submit" value="搜索" />
                        </form>
                        </div>
                    </div>
                </div>
                <a class="refresh" href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&status=<?php echo $_GET['status']; ?>
"></a>
                
                 <form method="post" target="export_iframe" id="export_form" action=""><input type="hidden" value="export" name="act"/></form>
    <iframe src="" style="display:none;" id="export_iframe" name="export_iframe"></iframe>
    <div style="float:right" id="els_export">
   	 		<a href="javascript:;" onclick="showSellAmount('<?php echo $this->_tpl_vars['amountCond']; ?>
');">显示总销售额</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" onclick="$('#export_form').submit();">导出EXCEL</a></div>
           </td>
        </tr>
    </table>
    <table class="table product">
       <tbody>
       <tr class="header">
            <th width="15"></th>
            <th width="40">查看</th>
            <th width="60">操作</th>
            <th width="60">打印</th>
            <th class="al">订单编号</th>
            <th width="130">订单总额</th>
            <th width="130">商品总价</th>
            <th width="100">买家名称</th>
            <th width="100">收货人</th>
            <th width="100">平台/系统</th>
            <th width="100">下单时间</th>
            <th width="110">订单状态</th>
            <th width="110">支付状态</th>
            <th width="110">配送状态</th>
            <th width="80">配送方式</th>
            <th width="80">支付方式</th>
        </tr>
        <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
        <tr class="<?php if ($this->_tpl_vars['list']['status'] == 1): ?>bold<?php endif; ?>">
            <td><img id="order_pro_<?php echo $this->_tpl_vars['list']['order_id']; ?>
" act="show" style="cursor:pointer;width:14px;height:14px;" onclick="showOrderProductsList('<?php echo $this->_tpl_vars['list']['order_id']; ?>
');" src="../image/admin/addchildboard.png" alt="" /></td>
            <td><a href="?m=product&s=order_detail.php&oid=<?php echo $this->_tpl_vars['list']['order_id']; ?>
">查看</a></td>
            <td>
            <?php if ($this->_tpl_vars['list']['status'] != 0 && $this->_tpl_vars['list']['status'] != 4): ?>
            <div class="operate">
                <a class="opear" href="#">操作<i></i></a>
                <ul>
<?php if (( $this->_tpl_vars['list']['status'] == 1 && $this->_tpl_vars['list']['pay_status'] == 1 ) || ( $this->_tpl_vars['list']['status'] == 2 && $this->_tpl_vars['list']['pay_status'] == 2 )): ?><li><a class="a-opear" data-type="edit" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">编辑</a></li><?php endif; ?>
<!-- <?php if ($this->_tpl_vars['list']['pay_status'] == 1): ?><li><a class="a-opear" data-type="pay" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">付款</a></li><?php endif; ?> -->
<?php if ($this->_tpl_vars['list']['status'] == 2 && $this->_tpl_vars['list']['pay_status'] == 2 && $this->_tpl_vars['list']['inventory_status'] == 1): ?><li><a class="a-opear" data-type="ship" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">发货</a></li><?php endif; ?>
<?php if ($this->_tpl_vars['list']['status'] == 3 && $this->_tpl_vars['list']['pay_status'] == 2 && $this->_tpl_vars['list']['ship_status'] == 2): ?><li><a href="module.php?m=product&s=order.php&orderid=<?php echo $this->_tpl_vars['list']['order_id']; ?>
<?php echo $this->_tpl_vars['cond']; ?>
">完成</a></li><?php endif; ?>
<?php if ($this->_tpl_vars['list']['status'] == 5): ?><li><a href="module.php?m=product&s=order.php&act=reback&orderid=<?php echo $this->_tpl_vars['list']['order_id']; ?>
<?php echo $this->_tpl_vars['cond']; ?>
">退货</a></li><?php endif; ?>
<li><a class="a-opear" data-type="remark" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">备注</a></li>
<?php if ($this->_tpl_vars['list']['status'] == 3): ?>
<li><a class="a-opear" data-type="edit_shipped" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">编辑</a></li>
<?php else: ?>
<li><a class="a-opear" data-type="cancel" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">取消</a></li>
<?php endif; ?>

                </ul>
            </div>
            <?php elseif ($this->_tpl_vars['list']['status'] == 4): ?>
<a class="a-opear" data-type="remark" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">备注</a>

            <?php else: ?>
            已取消
            <?php endif; ?>
            </td>
            <td>
            <?php if ($this->_tpl_vars['list']['status'] != 0 && $this->_tpl_vars['list']['status'] != 1 && $this->_tpl_vars['list']['pay_status'] != 1): ?>
            <div class="operate">
                <a class="opear" href="#"><?php if ($this->_tpl_vars['list']['print_status'] == 1): ?>已打印<?php else: ?>打印<?php endif; ?><i></i></a>
                <ul>
				<li><a class="a-opear" data-type="sendprint" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">发货单</a></li>
				<li><a class="a-opear" data-type="expressprint" data-param="{'id':'<?php echo $this->_tpl_vars['list']['order_id']; ?>
'}" href="#">快递单</a></li>
                </ul>
            </div>
            <?php elseif ($this->_tpl_vars['list']['status'] == 0): ?>
            已取消
            <?php else: ?>
           待付款
            <?php endif; ?>
            </td>
            
            <td class="al" style="position:relative;padding-left:32px;">
            <?php if ($this->_tpl_vars['list']['stock_shop']): ?><i style="background:url(/image/admin/<?php echo $this->_tpl_vars['list']['stock_shop']; ?>
.png);display: block;height: 32px;left: 0;top:50%; margin-top:-16px;position: absolute;width: 32px;"></i><?php endif; ?><?php echo $this->_tpl_vars['list']['order_id']; ?>
<br /><?php if ($this->_tpl_vars['list']['shipping_no'] != ''): ?>[<?php echo $this->_tpl_vars['list']['shipping_no']; ?>
]<?php endif; ?>
            <?php if ($this->_tpl_vars['list']['master_order_id'] > 0): ?>
            	<br /><a style="border:1px solid;" href="?m=product&s=order_detail.php&oid=<?php echo $this->_tpl_vars['list']['master_order_id']; ?>
" title="点击查看主订单详情">子订单</a>
            <?php endif; ?>
            </td>
            <td class="price_detail">
                <?php echo $this->_tpl_vars['config']['money']; ?>
<b><?php echo ((is_array($_tmp=$this->_tpl_vars['list']['sum'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</b>
<!--                 <?php echo $this->_tpl_vars['config']['money']; ?>
<b><?php echo ((is_array($_tmp=$this->_tpl_vars['list']['sum'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</b><br /><?php if ($this->_tpl_vars['list']['discount'] != 0): ?>[-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['discount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
]<?php endif; ?><?php if ($this->_tpl_vars['list']['cpns_price'] != 0): ?>[-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['cpns_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
]<?php endif; ?> -->
                <table class="price_detail_box bold">
                    <tr><td>活动优惠：</td><td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['discount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>代金券：</td><td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['cpns_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>运费：</td><td>&nbsp;<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['freight'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>行邮税：</td><td>&nbsp;<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['tax_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>保险费：</td><td>&nbsp;<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['insurance_fee'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>余额支付：</td><td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['cash_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                    <tr><td>实际支付：</td><td>&nbsp;<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['sum']-$this->_tpl_vars['list']['cash_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td></tr>
                </table>
            </td>
<!--             <td><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['cost'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
<br /><?php if ($this->_tpl_vars['list']['freight'] != 0): ?>[<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['freight'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
]<?php endif; ?></td> -->
            <td><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['cost'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td>
            <td><a href="?m=product&s=order.php&userid=<?php echo $this->_tpl_vars['list']['member_id']; ?>
"><?php if ($this->_tpl_vars['list']['mobile']): ?><?php echo $this->_tpl_vars['list']['mobile']; ?>
<?php else: ?><?php echo $this->_tpl_vars['list']['email']; ?>
<?php endif; ?><br/><?php if ($this->_tpl_vars['list']['order_type'] == 2): ?><b>(分销订单)</b><?php endif; ?><?php if ($this->_tpl_vars['list']['order_type'] == 3): ?><b>(微店订单)</b><?php endif; ?></a><?php if ($this->_tpl_vars['list']['order_type'] == 3): ?><br/><p>店铺ID:<?php echo $this->_tpl_vars['list']['ms_id']; ?>
</p><?php endif; ?></td>
            <td><?php echo $this->_tpl_vars['list']['ship_name']; ?>
</td>
            <td><?php echo $this->_tpl_vars['client_platform'][$this->_tpl_vars['list']['client_platform']]; ?>
/<?php echo $this->_tpl_vars['client_system'][$this->_tpl_vars['list']['client_system']]; ?>
</td>
            <td><?php echo ((is_array($_tmp=$this->_tpl_vars['list']['order_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d<br>%H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d<br>%H:%M:%S")); ?>
</td>
            <td>
            <?php if ($this->_tpl_vars['list']['finished_time']): ?><?php echo $this->_tpl_vars['list']['finished_time']; ?>
</br><?php endif; ?>
            <?php echo $this->_tpl_vars['list']['statu_text']; ?>

            <br /><?php if ($this->_tpl_vars['list']['status'] == 2): ?><?php if ($this->_tpl_vars['list']['inventory_status']): ?><b>(备货完成)</b><?php else: ?>(备货中)<?php endif; ?><?php endif; ?>
            </td>
            <td>
                <?php if ($this->_tpl_vars['list']['pay_time']): ?><?php echo $this->_tpl_vars['list']['pay_time']; ?>
</br><?php endif; ?>
                <?php echo $this->_tpl_vars['list']['order_pay_status']; ?>

            </td>
            <td>
                <?php if ($this->_tpl_vars['list']['ship_time']): ?><?php echo $this->_tpl_vars['list']['ship_time']; ?>
</br><?php endif; ?>
                <?php echo $this->_tpl_vars['list']['order_ship_status']; ?>

            </td>
            <td><?php echo $this->_tpl_vars['list']['shipping_name']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['payment_name']; ?>
</td>
        </tr>
        <?php endforeach; else: ?>
        <tr>
            <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
        </tr>
        <?php endif; unset($_from); ?>
		</tbody>
        <tfoot>
            <tr>
                <td colspan="99">
                	<div class="fl">每页最多显示： 20条</div>
                    <div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                    <div class="fr">共有<?php echo $this->_tpl_vars['de']['count']; ?>
条记录</div>
                </td>
            </tr>
        </tfoot>
    </table>
<script>
$(".a-opear").live('click',function(){
	
	var data = $(this).attr('data-param');
	eval("data = "+data);
	var type = $(this).attr('data-type');
	if(!data.id)
	{
		error('error','对不起，请选择订单后操作！');
		return false;
	}
	
	if(type=='sendprint'){
    	window.parent.iframe_form("sendprint", '发货单打印', '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=logistics&s=print.php&type=sendprint&oid='+data.id, 850,500);
		return false;
	}
	else if(type=='expressprint'){
    	window.parent.iframe_form("expressprint", '快递单打印', '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=logistics&s=print.php&type=expressprint&oid='+data.id, 900,580);
		return false;
	}
	
	window.parent.ajax_form("order", "操作订单", '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=order_opear.php&type='+type+'&orderid='+data.id, 800);
	return false;
	
});
$('.operate').hover(function(){					 
	if ($(this).position().top + $(this).children("ul").height() + $(this).parent("td").height() - $(window).height()- $(window).scrollTop()  < 0) {
		$(this).addClass("hover");
		$(this).children("ul").css("top", "22px");
	} else {
		$(this).addClass("hover-up");
		$(this).children("ul").css("top", -$(this).children("ul").height());
	}
},function(){
	$(this).removeClass("hover").removeClass("hover-up");	
});
$('.search').bind("mouseenter", function (e) {
	$(this).addClass("hover");
}).bind("mouseleave", function (e) {
	//$(this).removeClass("hover");
});
$('.close').bind("click", function (e) {
	$(this).parent().parent().removeClass("hover");
}) 
$('#stime,#p_stime,#s_stime').click(function () {
	var left = $("#Calendar").css("left");
	left = left.substring(0,left.length-2);
	left = left - 359;
	left = left+"px";
	var top = $("#Calendar").css("top");
	top = top.substring(0,top.length-2);
	top = top - 90;
	top = top+"px";
	$("#Calendar").css("left",left);
	$("#Calendar").css("top",top);
}) 
$('#etime,#p_etime,#s_etime').click(function () {
	var left = $("#Calendar").css("left");
	left = left.substring(0,left.length-2);
	left = left - 359;
	left = left+"px";
	var top = $("#Calendar").css("top");
	top = top.substring(0,top.length-2);
	top = top - 90;
	top = top+"px";
	$("#Calendar").css("left",left);
	$("#Calendar").css("top",top);
}) 
$('#stock_shop').bind('change',function(){
	$('#stock_shop_t').val($(this).val());
});
$(function(){
	$('.price_detail').hover(function(){
		$(this).parent().parent().find('.price_detail_box').hide();
		$(this).find('.price_detail_box').show();
	},function(){
		$(this).find('.price_detail_box').hide();
	});
});

//显示总销售额
function showSellAmount(cond){
	$.post('<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=order_opear.php',{"act":"getSellAmountByCond","cond":cond},function(s){
		window.parent.html_form('sellAmount','总销售额',s,800,300);
	});
}
</script>    
</div>
</body>
</html>